<?php 
  session_start();  
?>
<html>
<body> 
<?php
  include("Validator.php");
  if (!empty($_POST)){
	$pole = array();
$a=validEmail($_POST['vaha']) ;
if($a==0){    
  $pole['vaha'] = 'chyba vaha';}
  
  $b=validEmail($_POST['vyska']) ;
if($b==0){    
  $pole['vyska'] = 'chyba vyska';}
  
  $b=validEmail($_POST['pivo']) ;
if($b==0){    
  $pole['pivo'] = 'chyba pivo';} 	    

 }
if (isset($pole)){
if (!empty($pole)){
foreach ($pole as $k){
echo "<div>  " . $k . "</div><br/>";
echo "<meta http-equiv='refresh' content='5;url=kroldva.php'>";
}
}
else{
   $vaha=$_POST['vaha'];  
  $_SESSION['vaha']=$vaha;
  
  $vyska=$_POST['vyska'];  
  $_SESSION['vyska']=$vyska;
 
  $pivo=$_POST['pivo'];  
  $_SESSION['pivo']=$pivo;


echo "<meta http-equiv='refresh' content='1;url=kroktri.php'>";	 	    
}
} 
?> 
</body>
</html> 